#ifndef _PLAYER_H_
#define _PLAYER_H_

#include "vec.hpp"

class Stage;

class Enemy;
class Item;
class Door;

class Image;
class Sound;

#include "actor.hpp"

class Player : public Actor
{
public:
	Player();
	~Player();

	bool Vulnerable();
	bool Attacking();
	bool MeleeUpEarned();
	bool MeleeUpgradable();
	bool MeleeUpgrading();

	bool Open();
	void Close();

	void Init(float x, float y, Cue & cue);
	
	void In(const Vec2f & joy, int buttons);

	Vec2i StairFind(int diry);
	Vec2i StairTake(int diry);
	void Update();

	void Hit(Enemy & en);
	void Hit(Item & itm);
	void Hit(Door & door);

	void HUDInit();
	void HUDUpdate();

	Vec2f WeaponPos();

	void HPAdd(int delta);
	void AmmoAdd(int delta);
	void MeleeUp();

	static const int HPMAX;

	friend class Enemy;
	friend class Item;
	friend class Weapon;
	friend class GameScreen;

private:
	// attacks
	int attack;
	float attframe;
	void AttackEnd();

	// states
	int state;
	float stframe;
	void StateChange(int s);

	// game
	int ammo;
	int shield;
	bool shieldendwarn;
	int meleetype;
	int shottype;
};

extern Player Plr;

#endif
